<script id="dc_update" type="text/html">
	<form class="layui-form">  
		<div   style="padding: 2% ;">
		{{# layui.each(d.text, function(textKey, textValue) { }}
			{{# var flag = false;}}
			{{#  layui.each(d.input, function(inputKey, inputValue){ }}
				{{# layui.each(d.title, function(titleKey, titleValue) { }}
					
					<!-- 文本框   ==> text -->
					{{# if(titleKey==textKey&&titleKey==inputKey&&inputValue=="text"){ }}
						{{# flag = true;}}
						<div class="layui-form-item">
							<label class="layui-form-label">{{ titleValue }}</label>
							<div class="layui-input-block">
								<input name="{{textKey}}" lay-verify="title" value="{{ textValue }}" autocomplete="off" placeholder="请输入内容" class="layui-input" type="text">
							</div>
						</div>
					{{#}}}

                     <!-- 不可选中文本框   ==> text_readonly -->
					{{# if(titleKey==textKey&&titleKey==inputKey&&inputValue=="text_readonly"){ }}
						{{# flag = true;}}
						<div class="layui-form-item">
							<label class="layui-form-label">{{ titleValue }}</label>
							<div class="layui-input-block">
								<input name="{{textKey}}" lay-verify="title" value="{{ textValue }}" disabled="disabled" style="background:#CCCCCC" autocomplete="off" placeholder="" class="layui-input" type="text">
							</div>
						</div>
					{{#}}}

                     <!-- 文件上传域   ==> upload_file -->
					{{# if(titleKey==textKey&&titleKey==inputKey&&inputValue=="upload_file"){ }}
						{{# flag = true;}}
						<div class="layui-form-item">
							<label class="layui-form-label">{{ titleValue }}</label>
							<div class="layui-input-block">
								<input name="file" data_id = "{{textKey}}" type="file" class="layui-upload-file" lay-type="file" >
							</div>
						</div>
					{{#}}}

                    <!-- 搜索选择框  ==> search_select -->
                 	{{# if(titleKey==textKey&&titleKey==inputKey&&inputValue=="search_select"){ }}
						{{# flag = true;}}
						<div class="layui-form-item">
							<label class="layui-form-label">{{ titleValue }}</label>
                            <div class="layui-input-block">
                              <select name="{{textKey}}" lay-verify="search_select" lay-search="" id="search_select">
                              </select>
                           </div>
						</div>
					{{#}}}
					

					<!-- 下拉单选框  ==> select -->
					{{# if(titleKey==textKey&&titleKey==inputKey&&inputValue=="select"){ }}
						{{# flag = true;}}
						<div class="layui-form-item">
							<label class="layui-form-label">{{ titleValue }}</label>
							<div class="layui-input-block">
								<select name="{{textKey}}" lay-filter="select" id="select">
									<option value="" ></option>
								</select>
							</div>
						</div>
					{{#}}}


					{{# if(titleKey==textKey&&titleKey==inputKey&&inputValue=="new_select"){ }}
						{{# flag = true;}}
						<div class="layui-form-item">
							<label class="layui-form-label">{{ titleValue }}</label>
							<div class="layui-input-block">
								<select name="{{textKey}}" lay-filter="new_select" id="new_select">
									<option value="" ></option>
								</select>
							</div>
						</div>
					{{#}}}

					{{# if(titleKey==textKey&&titleKey==inputKey&&inputValue=="select2"){ }}
					{{# flag = true;}}
					<div class="layui-form-item">
						<label class="layui-form-label">{{ titleValue }}</label>
						<div class="layui-input-block">
							<select name="{{textKey}}" lay-filter="select2" id="select2">
								<option value="" ></option>
							</select>
						</div>
					</div>
					{{#}}}

					{{# if(titleKey==textKey&&titleKey==inputKey&&inputValue=="select3"){ }}
					{{# flag = true;}}
					<div class="layui-form-item">
						<label class="layui-form-label">{{ titleValue }}</label>
						<div class="layui-input-block">
							<select name="{{textKey}}" lay-filter="select3" id="select3">
								<option value="" ></option>
							</select>
						</div>
					</div>
					{{#}}}

					{{# if(titleKey==textKey&&titleKey==inputKey&&inputValue=="_select"){ }}
						{{# flag = true;}}
						<div class="layui-form-item">
							<label class="layui-form-label">{{ titleValue }}</label>
							<div class="layui-input-block">
								<select name="{{textKey}}" lay-filter="_select" id="_select">
									<option value="" ></option>
								</select>
							</div>
						</div>
					{{#}}}

					<!-- 时间选择框 ==> data -->
					{{# if(titleKey==textKey&&titleKey==inputKey&&inputValue=="data"){ }}
						{{# flag = true;}}
						<div class="layui-form-item">
							<label class="layui-form-label">{{ titleValue }}</label>
							<div class="layui-inline">
								<input name="{{textKey}}" id="date" lay-verify="date"
									placeholder="yyyy-mm-dd" autocomplete="off" class="layui-input"
									onclick="layui.laydate({elem: this})" type="text" value="{{textValue}}">
							</div>
						</div>
					{{#}}}
					
					<!-- 文本域 ==> textarea -->
						{{# if(titleKey==textKey&&titleKey==inputKey&&inputValue=="textarea"){ }}
						{{# flag = true;}}
						<div class="layui-form-item">
							<label class="layui-form-label">{{ titleValue }}</label>
							<div class="layui-input-block">
								<textarea  name="{{textKey}}" placeholder="请输入内容" class="layui-textarea">{{textValue}}</textarea>
							</div>
						</div>
					{{#}}}

					<!-- 文本域 ==> textarea -->
					{{# if(titleKey==textKey&&titleKey==inputKey&&inputValue=="textarea_no"){ }}
					{{# flag = true;}}
					<div class="layui-form-item">
					<div class="layui-form-item">
						<label class="layui-form-label">{{ titleValue }}</label>
						<div class="layui-input-block">
							<textarea name="{{textKey}}" placeholder="请输入内容" disabled="disabled" class="layui-textarea">{{textValue}}</textarea>
						</div>
					</div>
					{{#}}}


					
					<!-- 开关按钮==> checkbox -->
					{{# if(titleKey==textKey&&titleKey==inputKey&&inputValue=="switch"){ }}
						{{# flag = true;}}
					  	<div class="layui-form-item">
						    <label class="layui-form-label">{{ titleValue }}</label>
						    <div class="layui-input-block" id="switch">
						    </div>
  						</div>
					{{#}}}
				

					<!-- 复选框==> checkbox -->
					{{# if(titleKey==textKey&&titleKey==inputKey&&inputValue=="checkbox"){ }}
						{{# flag = true;}}
					  	<div class="layui-form-item">
						    <label class="layui-form-label">{{ titleValue }}</label>
						    <div class="layui-input-block" id="checkbox">
						    	{{# layui.each(d.input_init[inputKey], function(index, input_textValue) { }}
						      		<input name="{{textKey}}" value="{{input_textValue}}" {{# if(textValue===input_textValue){ }} checked {{#} }}  title="{{input_textValue}}" type="checkbox">
					      		{{#  }); }}
						    </div>
  						</div>
					{{#}}}

					<!-- 复选框==> checkbox -->
					{{# if(titleKey==textKey&&titleKey==inputKey&&inputValue=="new_checkbox"){ }}
					{{# flag = true;}}
					<div class="layui-form-item">
						<label class="layui-form-label">{{ titleValue }}</label>
						<div class="layui-input-block" id="new_checkbox">
							{{# layui.each(d.input_init[inputKey], function(index, input_textValue) { }}
							<input name="{{textKey}}" value="{{input_textValue}}" {{# if(textValue===input_textValue){ }} checked {{#} }}  title="{{input_textValue}}" type="checkbox">
							{{#  }); }}
						</div>
					</div>
					{{#}}}

					<!-- 复选框==> checkbox -->
					{{# if(titleKey==textKey&&titleKey==inputKey&&inputValue=="new1_checkbox"){ }}
					{{# flag = true;}}
					<div class="layui-form-item">
						<label class="layui-form-label">{{ titleValue }}</label>
						<div class="layui-input-block" id="new1_checkbox">
							{{# layui.each(d.input_init[inputKey], function(index, input_textValue) { }}
							<input name="{{textKey}}" value="{{input_textValue}}" {{# if(textValue===input_textValue){ }} checked {{#} }}  title="{{input_textValue}}" type="checkbox">
							{{#  }); }}
						</div>
					</div>
					{{#}}}

			<!-- 单选框==> radio -->
					{{# if(titleKey==textKey&&titleKey==inputKey&&inputValue=="radio"){ }}
						{{# flag = true;}}
					  	<div class="layui-form-item">
						    <label class="layui-form-label">{{ titleValue }}</label>
						    <div class="layui-input-block" id="radio">
						    	{{# layui.each(d.input_init[inputKey], function(index, input_textValue) { }}
						      		<input name="{{textKey}}" value="{{input_textValue}}" {{# if(textValue===input_textValue){ }} checked {{#} }}  title="{{input_textValue}}" type="radio">
					      		{{#  }); }}
						    </div>
  						</div>
					{{#}}}


			<!--  添加按钮==> radio -->
			{{# if(titleKey==textKey&&titleKey==inputKey&&inputValue=="btn"){ }}
			{{# flag = true;}}
			<div class="layui-form-item">
				<label class="layui-form-label">{{ titleValue }}</label>
				<div class="layui-input-block" >
					<button class="layui-btn" lay-submit="" lay-filter="add_btn" type="button" id="add_btn"> 添加</button>
					<button class="layui-btn" lay-submit="" lay-filter="del_btn" type="button" id="del_btn">删除</button>
				</div>
			</div>
			{{#}}}

					
					<!-- 可自行扩充表单-->
			<!-- 弹窗内带右上角的按钮的textarea   ==> textarea_btn -->
			{{# if(titleKey==textKey&&titleKey==inputKey&&inputValue=="textarea_btn"){ }}
			{{# flag = true;}}
			<div class="layui-form-item">
				<label class="layui-form-label">{{ titleValue }}
				</label>
				<div class="layui-input-block">
					<input name="{{textKey}}" lay-verify="title"  style="cols:1;rows:5" value="{{ textValue }}" autocomplete="off" placeholder="按钮内容：user:add:*" class="layui-textarea" type="textarea">
					<input id="textarea_btn" name="textarea_btn"    value="资源按钮" lay-filter="textarea_btn"  class="layui-btn  textarea_btn layui-btn-primary layui-btn-sm" type="button" ><i class="layui-icon textarea_btn_li">&#xe654;
				</i></input>
					<!--<button type="button" name="textarea_btn" value="添加资源按钮" lay-filter="textarea_btn" id="textarea_btn" class="layui-btn textarea_btn layui-btn-primary layui-btn-sm"><i class="layui-icon textarea_btn_li">&#xe654;</i></button>-->
				    <!--<input name="textarea_btn" l value="textarea_btn" lay-filter="textarea_btn"  class="layui-btn" type="button" ><i class="layui-icon">&#xe654;</i></input>-->
				</div >

			</div>
			{{#}}}

			<!-- 文本框中不带placeholder  ==> textnotip -->
			{{# if(titleKey==textKey&&titleKey==inputKey&&inputValue=="textnotip"){ }}
			{{# flag = true;}}
			<div class="layui-form-item">
				<label class="layui-form-label">{{ titleValue }}</label>
				<div class="layui-input-block">
					<input name="{{textKey}}" lay-verify="title" value="{{ textValue }}" autocomplete="off" placeholder="" class="layui-input" type="text">
				</div>
			</div>
			{{#}}}

			<!-- 文本框中  ==> password -->
			{{# if(titleKey==textKey&&titleKey==inputKey&&inputValue=="password"){ }}
			{{# flag = true;}}
			<div class="layui-form-item">
				<label class="layui-form-label">{{ titleValue }}</label>
				<div class="layui-input-block">
					<input type="password" name="{{textKey}}" required lay-verify="required" value="{{ textValue }}"  placeholder="请输入密码" autocomplete="off" class="layui-input">
				</div>
			</div>
			{{#}}}



					
				{{#  }); }}
			{{#  }); }}
			<!-- 隐藏域==> hidden -->
			{{# if(!flag){ }}
					<input type="hidden" name="{{textKey}}" value="{{textValue}}"/>
			{{#}}}
	  	{{#  }); }}
		</div> 
	</from>
</script>

	<script type="text/html" id="demo">
		<table class="layui-table">
			{{# if(d.title_name !=undefined){ }}
			 	<tbody>
					<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
  						<legend>{{d.title_name}}</legend>
					</fieldset>
				</tbody>
		    {{#}}}
			{{# if(typeof(d.btn_title) == "object"){ }}
				<tbody>
			      {{#  layui.each(d.btn_title, function(index, item){ }}
					{{# var name;var event;}}
					{{#  layui.each(item, function(key, value){ }}
						{{# if(key==0){ }}
							{{# name = value;}}
						{{#}}}
						{{# if(key!==0){ }}
							{{# event = value;}}
						{{#}}}
			      	{{#  }); }}
				 <button class="layui-btn layui-btn-mini layui-btn-normal" onclick="{{event}}" style="background:#545657;">{{name}}</button>
				 {{#  }); }}
				</tbody>
    		{{# }}}
			    <thead>
			      	<tr>
			        	{{#  layui.each(d.title, function(index, item){ }}
			        	<th>{{item}}</th>
			        	{{#  }); }}
			      	</tr> 
			    </thead>
			    <tbody>
			    	{{#  layui.each(d.list, function(index, listItem){ }}
			      	<tr>
			      		{{#  layui.each(d.title, function(titleKey, titleValue){ }}
				        	{{#  layui.each(listItem, function(key, value){ }}
			        	    	{{# if(d.title[key]!=undefined&&key==titleKey){}}
			        	    		<td field="{{key}}">
										{{# if(value==null){ }}
											{{"aaa"}}
										{{#} }}
										{{# if(value!=null){ }}
			        						{{value}}
										{{#} }}
			        				</td>
			        			{{#}}}
				        	{{#  }); }}
			        	{{#  }); }}
			        	
			        	{{# if(typeof(d.btn) == "object"){ }}
			        	 <td> 
 				          {{#  layui.each(d.btn, function(index, item){ }}
					         {{# var name;var event;}}
					            {{#  layui.each(item, function(key, value){ }}
						           {{# if(key==0){ }}
							          {{# name = value;}}
						           {{#}}}
						           {{# if(key!==0){ }}
							          {{# event = value;}}
						           {{#}}}
			      	           {{#  }); }}
			      	           
			      	        {{#  var  data_key=''; }}  
			      	        {{#  layui.each(d.hidden_field, function(data_idKey, data_idValue){ }}
				          		{{#   data_key+=' data_'+data_idKey+'="'+listItem[data_idKey]+'"' }}  
				            {{#  }); }}
				            <button class="layui-btn layui-btn-small"  {{data_key}} onclick="{{event}}">{{name}}</button> 
				          {{#  }); }}
			        	</td>
			        	{{# }}}
			        	
			      	</tr>
			      	{{#  }); }}
		    	</tbody>
		  	</table>	
	</script>
<script type="text/html" id="layuiTable">
		 <table class="layui-table">
		 	 <thead>
			    <tr>
			    	{{# if(d.dataTool.titleCheckbox!=undefined&&d.dataTool.titleCheckbox){}}
				    	<th>
				        	<input lay-skin="primary" lay-filter="allChoose" type="checkbox">全选aaa
				        </th>
			        {{#}}}
			     	{{# layui.each(d.dataTool.title, function(index, item){ }}
			        	<th>{{item}}</th>
			        {{#  }); }}
		       </tr>
		       </thead>
			    <tbody>
			    	{{#  layui.each(d.list, function(index, listItem){ }}
			    		{{#  var data_obj = new Array(); }}
			    		{{#  layui.each(listItem, function(key, value){ }}
			    			{{# data_obj.push(key+":'"+value+"'");}}
			    		{{#  }); }}
			    		{{# data_obj= "{"+data_obj.join(',')+"}"; }}
			      	<tr>
			      		{{# if(d.dataTool.titleCheckbox!=undefined&&d.dataTool.titleCheckbox){}}
				    		<td>
				      			<input lay-skin="primary" lay-filter="oneCbx" name="cbx" value="{{data_obj}}"  type="checkbox">
				      		</td>
			        	{{#}}}
			      		{{#  layui.each(d.dataTool.title, function(titleKey, titleValue){ }}
				        	{{#  layui.each(listItem, function(key, value){ }}
			        	    	{{# if(d.dataTool.title[key]!=undefined&&key==titleKey){}}
			        	    		<td field="{{key}}">
			        	    			{{# if(d.dataTool.href!=undefined&&d.dataTool.href.field==key){}}
										<a href="javascript:" onclick="{{d.dataTool.href.event}}({;{data_obj}})">
			        					{{#}}}

										{{#  layui.each(d.dataTool.stateData, function(stateKey, stateValue){ }}
			        						{{# if(stateValue['stateField']==key){}}
			        							{{#  layui.each(stateValue.stateArray, function(arrKey, arrValue){ }}
			        								{{# if(arrValue[value]!=undefined){}}
			        									{{#  value = '<font style='+arrValue.style+'>'+arrValue[value]+'</font>'}}
			        								{{#}}}	
			        							{{#  }); }}
			        						{{#}}}
			        					{{#  }); }}

											{{# if(d.dataTool.fold!=undefined&&key==d.dataTool.fold.field){}}
				        					{{# var uuidIndex = uuid();}}
											<div class="panel">
												<div class="panel-heading">
													<h4 class="panel-title">
														<a data-toggle="collapse" data-parent="#accordion" 
														   href="#collapse{{uuidIndex}}">
														    <span class="fold">
														    	{{#  layui.each(d.dataTool.fold.listfield, function(foldIndex, foldField){ }}
				        									  		{{foldField.title}}&nbsp;&nbsp;&nbsp;
																{{#  }); }}
														    </span>
														    <span style="color:red;">点我查看详细</span>
														</a>
													</h4>
												</div>
												<div id="collapse{{uuidIndex}}" class="panel-collapse collapse">
													<div class="panel-body">
														{{#  layui.each(listItem[d.dataTool.fold.listname], function(foldKey, foldObj){ }}
																<p>
					        									{{#  layui.each(d.dataTool.fold.listfield, function(foldIndex, foldField){ }}
					        									  {{foldObj[foldField.field]}}&nbsp;&nbsp;&nbsp;
																{{#  }); }}
																</p>
														{{#  }); }}
													</div>
												</div>
											</div>
											{{# value=''; }}
			        					{{#}}}
			        					
			        				
			        					{{# if(d.dataTool.imglistfield!=undefined && $.inArray(key, d.dataTool.imglistfield)!=-1){}}
			        						<img src="{{value}}" width="100" height="100"/>
			        						{{# value=''; }}
			        					{{#}}}

			        					{{value}}ss
			        					{{# if(d.dataTool.href!=undefined&&d.dataTool.href.hrefField==key){}}
			        					</a>
			        					{{#}}}
			        				</td>
			        			{{#}}}
				        	{{#  }); }}
			        	{{#  }); }}
			        	
			        	{{# if(typeof(d.dataTool.btn) == "object"){ }}
			        	<td> 
 				          {{#  layui.each(d.dataTool.btn, function(index, item){ }}
				            <button type="button" class="layui-btn layui-btn-small"   onclick="{{item.event}}({;{data_obj}})">{{item.name}}</button>
				          {{#  }); }}
			        	</td>
			        	{{# }}}
			        	
			        	{{# if(typeof(d.dataTool.btnHref) == "object"){ }}
			        	<td> 
 				          {{#  layui.each(d.dataTool.btnHref, function(index, item){ }}
				            <a href="javascript:" onclick="{{item.event}}({;{data_obj}})">
			            		{{# var styleCss = ""; }}
			            		{{# if(item.style!=undefined){ }}
			            			{{# styleCss = item.style; }}
				            	{{# }}}
			            		<font style="{{styleCss}}">
				            	{{item.name}}
				            	</font>
				            </a>
				          {{#  }); }}
			        	</td>
			        	{{# }}}
			      	</tr>
			      	
			      	{{#  }); }}
		    	</tbody>
		  	</table>
			{{# if(d.dataTool.noDataStatus!=undefined&&d.dataTool.noDataStatus){}}
		  		{{# if($.isEmptyObject(d.list)||d.list.length==0){}}
				    <div class="text-center">无数据</div>
				{{#}}}
			{{#}}}
</script>